home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Netwerk⁄Telecom / ARA Demoscript Folder / AppleTalk Remote Access- Sample next >
Encoding:
Text File  |  1992-06-28  |  21.7 KB  |  564 lines  |  [TEXT/GEOL]

  1. The following article was written by Jim Kateley and originally posted to the
  2. Tech Info Library.  Due to many requests for sample scripts, we have decided to
  3. also post the article here within Apple SW Updates.
  4. -------------------------------------------------------------------------------
  5. AppleTalk Remote Access: Sample V.32bis Script
  6.  
  7. TOPIC-------------------------------------------------------------------------
  8.  
  9. I have this new V.32bis modem, and I'd just love to use it with
  10. AppleTalk Remote Access.  There isn't a script on the application disk that I
  11. can use with it.  What should I do?
  12.  
  13. DISCUSSION--------------------------------------------------------------------
  14.  
  15. This discussion assumes that you have access to the documentation for
  16. AppleTalk Remote Access, and are familiar with the command syntax and
  17. scripting basics.
  18.  
  19. The following AppleTalk Remote Access script for the Telebit T3000 modem is
  20. a good example of how to write a script for any given V.32bis modem.
  21.  
  22. There is additional information available on AppleLink that discusses
  23. specific issues surrounding using ARA with V.32bis modems.
  24.  
  25. The command syntax can be found in the AppleTalk Remote Access Modem Scripting
  26. Language Guide, available from APDA.  You can reach APDA for telephone orders
  27. at 800 282-2732 USA, 800 637-0029 Canada, and 408 562-3910 International.
  28. ______________________________________________________________________________
  29. ! "Telebit T3000 Modem 11/11/91" JFK
  30. ! 11/14/91 JFK - Added a ton o' comments...
  31. ! 11/23/91 JFK - Cleaned up comments a little bit more,
  32. !                and added S11=50.
  33. ! 12/2/91  JFK - Took S11 back out.
  34. ! 12/9/91  JFK - Added the pinouts for the RTS/CTS cable to the comments
  35. !                Since you have to make a hardware handshaking cable.
  36. ! 1/16/92  JFK - Add a bunch more comments about the cable.
  37. ! 3/30/92  JFK - Added comments about the hang up sequence.
  38. ! 3/31/92  JFK - Added sbreak in hangup sequence to speed things up.
  39. ! 3/31/92  JFK - Added S38=3 to help ensure that the modem will be
  40. !                able to transmit all the data in its buffer (including
  41. !                the disconnect command for the remote modem!) before
  42. !                it hangs up.
  43. ! 4/2/92   JFK - Changed S38 to 255.  See notes below.
  44. ! 4/2/92   JFK - Changed S51 to 254 in hang up sequence since 19200 is
  45. !                our DTE speed.
  46. !
  47. !  Note the cable requirements when using a V.32bis modem.  Since a lot
  48. !  of people do not have this cable, you should not use this approach when
  49. !  scripting for V.32 or slower modems.
  50. !
  51. ! Cable needed to use AppleTalk Remote Access with V.32bis modems:
  52. !   Din-8    DB-25
  53. ! 1 (DTR)   4,20 (RTS, DTR)
  54. ! 2 (CTS)   5 (CTS) *
  55. ! 3 (TxD-)  2 (TD)
  56. ! 4 (SG)    7 (SG)
  57. ! 5 (RxD-)  3 (RD)
  58. ! 6 (TxD+)  Not Connected
  59. ! 7 (GPi)   8 (DCD)
  60. ! 8 (RxD+)  7 (SG)
  61. !
  62. ! * Normally 2(CTS)<-!6 (DSR) on other Macintosh cables.
  63. !
  64. !-  One consequence of using this cable is that DSR (or DCD) from the modem is
  65. !   no longer connected to the Macintosh.  This does not let your Macintosh
  66. !   communication software use the DSR (or DCD) signal to detect carrier loss.
  67. !   And since the Macintosh Serial driver does not support the GPi input...you
  68. !   are sort of stuck, unless your communications software does use the GPi
  69. !   input.  Or Apple builds GPi support into the serial driver.
  70. !
  71. !-  Since DTR and RTS are connected together, the modem must be configured
  72. !   to ignore DTR (usually the &D0 command) when using this cable with other
  73. !   communications applications.  Otherwise, when RTS handshaking from the Mac
  74. !   is used, the modem will drop connection the first time the Mac de-asserts
  75. !   RTS.
  76. !
  77. !-  If there is a need to use DTR to make the modem disconnect, RTS handshaking
  78. !   cannot be used to control the flow of data from the modem to the Macintosh
  79. !   CTS handshaking (from the modem to the Macintosh) is available.  This is
  80. !   what ARA does so it can force the modem to hang up, and at the same time
  81. !   the modem can signal the Macintosh to stop sending data.  This assumes that
  82. !   the Macintosh will always be able to accept data from the modem.  This will
  83. !   not be true if the Macintosh is talking to the modem at 57.6KBps with
  84. !   V.32bis & V.42Bis.  There will be times when the Macintosh will need to
  85. !   signal the modem to stop sending data.
  86. !
  87. !In summary, with this cable:
  88. !
  89. !If you want to use RTS hardware handshaking, you cannot use DTR to control the
  90. !modem.  You will have to resort to other methods to coerce the modem to
  91. !disconnect.
  92. !
  93. !If you want to control the modem with DTR, you cannot use RTS hardware
  94. !handshaking so the Macintosh must be able to accept data from the modem at all
  95. !times, or can recover if data is lost.
  96. !
  97. !In either case you can use CTS hardware handshaking so the modem can signal
  98. !the Macintosh to discontinue sending data.
  99. !
  100. @ORIGINATE
  101. @ANSWER
  102. !
  103. ! Talk to the modem at 19,200 bps.  the T3000 should auto-baud this
  104. ! unless the user has locked the port to a particular speed.  If it
  105. ! is locked to a different speed, the user will need to change that.
  106. !
  107. serreset 19200, 0, 8, 1
  108. !
  109. !  The idea here is to get the modem into a known state, and then change only
  110. !  the registers that are necessary to support the connection.  Most of the
  111. !  time AT&F will be sufficient, but some modems allow the user to change the
  112. !  F0 parameters.  There isn't much that can be done to prevent this, but if
  113. !  the modem has any pre-configured configurations, and one of them sets
  114. !  hardware handshaking, use it.
  115. !
  116. ! Recall the factory configuration
  117. ! F9 is the built in pre-configured setting for CTS/RTS handshaking on the
  118. ! T3000.  Since it's possible for the user to modify F0 parameters, this is a
  119. ! little safer.
  120. !
  121. ! AT&F9 sets:
  122. ! &C1 - DCD is on after connect
  123. ! &D2 - DTR on/off disconnects
  124. ! S58=2 - Use RTS/CTS flow control in full-duplex mode
  125. ! S61=1 - Go into command mode when receiving break from DTE (see
  126. !         @HANGUP for why the script cares about this).
  127. !
  128. !  Every time the script needs to send commands to the modem, the strategy is:
  129. !  Clear all matchstrings, look for specific responses, and loop around a
  130. !  couple of times.  Later in the script, certain loops pause 50-70 seconds,
  131. !  such as when the script dials a number and is waiting for a connection.
  132. !  Other times, the script pauses 3-5 seconds and loops around. When the script
  133. !  is sending commands to the modem, it should expect to see a response within
  134. !  a couple of seconds, so it's best to look quickly and exit with an error in
  135. !  a reasonable amount of time so the user does not wait a for a long time
  136. !  before they are notified that they may need to power-cycle/reset the modem.
  137. !  When the script is dialing out over a telephone system or PBX, it needs
  138. !  enough time to make a connection.  In short, if it's communicating to a
  139. !  modem, loop in 3-7 second increments.  If the script is waiting for
  140. !  something other than a modem response (like a completed connection or
  141. !  terminal server) it may need 60-70 seconds.
  142. !
  143. !  If the defaults cannot be set, jump down to label 59, which exits and asks
  144. !  the user to check out the modem.  If an  AT&F command will not be accepted,
  145. !  the modem may be hung and needs to be manually reset.
  146. !
  147. settries 0
  148. matchclr
  149. @LABEL 1
  150. matchstr 1 4 "OK\13\10"
  151. write "AT&F9\13"
  152. matchread 30
  153. inctries
  154. iftries 2 59
  155. ! Modem is not responding, reset and send a break
  156. DTRClear
  157. pause 5
  158. DTRSet
  159. SBreak
  160. jump 1
  161. !
  162. !  The script was able to get the modem into a default factory state.  Now
  163. !  set the basic hardware type configuration such as command echo, hardware
  164. !  handshaking, and DTR control.  If the &F9 command had not set up handshaking
  165. !  this is where it would be done.  It's not desirable to create one long
  166. !  command string with everything on it because some modems cannot handle a
  167. !  long command string, and long strings are harder to debug.  It's easy
  168. !  to enter an incorrect S-register value.  For the most part, the following
  169. !  commands are probably common across a lot of modems, but always look up the
  170. !  commands in the modem manual.
  171. !
  172. ! Next, Set up the configuration: drop connection after losing DTR
  173. ! Turn off auto answer and command echo.
  174. !
  175. ! &D3 - DTR on/off resets modem
  176. ! S0=0 - Don't answer calls
  177. ! E0 - Turn command echo off
  178. !
  179. @LABEL 4
  180. matchclr
  181. pause 5
  182. matchstr 1 5 "OK\13\10"
  183. write "AT&D3S0=0E0\13"
  184. matchread 30
  185. jump 59
  186. !
  187. !  Now that the modem hardware & flow control parameters are set, make sure any
  188. !  protocol negotiation is disabled, and issue any modem specific features
  189. !  here.  Make sure that MNP4/V.42, and MNP5-10/V.42bis negotiations are
  190. !  disabled.  By the way, some V.32/V.32bis modems have an option to disable
  191. !  Trellis error control,  which is part of the physical layer modulation.
  192. !  This is not the same as MNP/V.42, and you do not want to disable it!
  193. !
  194. !  Make sure that the modem is configured so it does NOT require error control
  195. !  to complete a link.  ARA 1.0 does all error correction/data compression in
  196. !  software.  All ARA wants is the fastest raw data pipe it can get.  If the
  197. !  script spends time trying to negotiate some error control, the modems and/or
  198. !  Remote Access may time out.
  199. !
  200. !  Also note the S38 configuration.  It is noted later in the script that it is
  201. !  desirable to ensure that the modem's buffer has transmitted all of it's data
  202. !  before it actually hangs the modem up.  This ability appears to be
  203. !  implemented on a lot of modems.
  204. !
  205. !  This set of commands is going to be implemented differently on different
  206. !  vendors V.32bis modems.  In this example, Telebit uses S registers.
  207. !  Other modems may use S registers (but different registers), or \
  208. !  commands, or % commands; you get the idea.  (Did I mention that you
  209. !  really, really want to have your modem manual handy?)
  210. !
  211. !  It is important that the modem is configured so that it returns
  212. !  the connected speed, NOT the DTE speed.  The script need to know what the
  213. !  real line speed is in order to set ARA's internal timers.  Some
  214. !  modems don't have the option to display the line speed.  In that case the
  215. !  performance of the connection may not be optimal.
  216. !
  217. ! Next, disable MNP and error control
  218. ! Turn on internal buffering (for V.32bis), set the delay before disconnect,
  219. ! and extended result codes (CTS/RTS flow control was set when we issued &F9,
  220. ! so it is not necessary to do it again).
  221. !
  222. ! S180=0 - Turn off all error detection/correction (ARA does MNP and
  223. !          compression itself.  It needs these turned off in the modem).
  224. ! S181=1 - Turn *on* DTE <-> line buffering if there is no error control.
  225. !                            Since the modem will be talking to the Mac at
  226. !                            19,200 bps no matter what speed it connects at,
  227. !                            this needs to be on.
  228. ! S38=255  - Wait until the modem's buffer is clear OR the other modem
  229. !            disconnects after an ATH is issued before dropping the line.
  230. !            This is done to ensure that all any data in the modem's buffer
  231. !            has been transmitted to the remote modem before it disconnects.
  232. !            If the remote connection does not receive the
  233. !            disconnect packet (usually the last one sent) it could take
  234. !            up to 45 seconds for the remote connection to timeout and
  235. !            disconnect.
  236. ! X2 - Issue extended result codes.  This will display busy, connect XXX, etc.
  237. !      X2 will say "CONNECT XXX"  Where XXX is the line speed (as opposed to
  238. !      DTE speed).  This is so ARA can determine what speed the modems are
  239. !      communicating at for timing.
  240. !
  241. @LABEL 5
  242. pause 5
  243. matchstr 1 6 "OK\13\10"
  244. write "ATS180=0S181=1S38=255X2\13"
  245. matchread 30
  246. jump 59
  247. !
  248. !  The modem should now be properly configured.  Now check to see if the user
  249. !  has turned off the modem speaker.  If they have, send an additional command
  250. !  to turn it off.
  251. !
  252. ! If speaker on flag is true, jump to label 8.  Otherwise turn off the speaker.
  253. !
  254. @LABEL 6
  255. ifstr 2 8 "1"
  256. pause 5
  257. matchstr 1 8 "OK\13\10"
  258. write "ATM0\13"
  259. matchread 30
  260. jump 59
  261. !
  262. ! The modem is ready so enable answering, or originate a call.
  263. !
  264. @LABEL 8
  265. pause 5
  266. ifANSWER 30
  267. note "Dialing ^1" 3
  268. write "ATDT^1\13"
  269. !
  270. !  Be aware that different modems will have different format strings
  271. !  to return connection results.  You need to understand the different possible
  272. !  strings and set this area (and then answer area at label 31) to the
  273. !  appropriate value.  Also, remember that the modem was configured to return
  274. !  the connect speed if possible (The X2 command up at label 5).  It's also
  275. !  useful if the modem can return busy, no dialtone, etc. since the script will
  276. !  be able to exit quicker and let the user know what is going on.
  277. !
  278. !  Also note that the script waits at the bottom of label 9 for a 70 seconds,
  279. !  rather then looping around.  Why?  Well, if the script re-issues the dial
  280. !  command too soon, that would cause the modem to hang up.  At this point the
  281. !  script should wait a reasonable amount of time for one of these strings to
  282. !  return from the modem and take the appropriate action.
  283. !
  284. @LABEL 9
  285. matchstr 1  11 "CONNECT 1200\13\10"
  286. matchstr 2  12 "CONNECT 2400\13\10"
  287. matchstr 3  13 "CONNECT 4800\13\10"
  288. matchstr 4  19 "CONNECT 7200\13\10"
  289. matchstr 5  14 "CONNECT 9600\13\10"
  290. matchstr 6  20 "CONNECT 12000\13\10"
  291. matchstr 7  18 "CONNECT 14400\13\10"
  292. matchstr 8  50 "NO CARRIER\13\10"
  293. matchstr 9  50 "ERROR\13\10"
  294. matchstr 10 52 "NO DIALTONE\13\10"
  295. matchstr 11 53 "BUSY\13\10"
  296. matchstr 12 54 "NO ANSWER\13\10"
  297. matchread 700
  298. jump 59
  299. !
  300. !  All that is done for different connect speeds is to issue a
  301. !  "CommunicatingAt" command.  Remember, the interface speed is locked
  302. !  to 19,200 bps so the script doesn't want to reset the serial speed after it
  303. !  connects.
  304. !
  305. !  CommunicatingAt tells ARA what the actual line speed is so that it
  306. !  can set it's timers appropriately.  I guess performance would be
  307. !  sub-optimal if this is not set...
  308. !
  309. @LABEL 11
  310. note "Communicating at 1200 bps." 2
  311. CommunicatingAt 1200
  312. jump 15
  313. !
  314. @LABEL 12
  315. note "Communicating at 2400 bps." 2
  316. CommunicatingAt 2400
  317. jump 15
  318. !
  319. @LABEL 13
  320. note "Communicating at 4800 bps." 2
  321. CommunicatingAt 4800
  322. jump 15
  323. !
  324. @LABEL 19
  325. note "Communicating at 7200 bps." 2
  326. CommunicatingAt 7200
  327. jump 15
  328. !
  329. @LABEL 14
  330. note "Communicating at 9600 bps." 2
  331. CommunicatingAt 9600
  332. jump 15
  333. !
  334. @LABEL 20
  335. note "Communicating at 12000 bps." 2
  336. CommunicatingAt 12000
  337. jump 15
  338. !
  339. @LABEL 18
  340. note "Communicating at 14400 bps." 2
  341. CommunicatingAt 14400
  342. jump 15
  343. !
  344. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  345. ! command below )
  346. !
  347. !  The modems have connected, so enable hardware handshaking on the serial
  348. !  port.  If the script is answering a telephone call, just exit right away and
  349. !  starting communicating.  If the script is dialing out, give the other end
  350. !  some time (3 seconds in this example) to get ready to talk to this modem.
  351. !  Exit 0 tells Remote Access that the script was successful in attempting a
  352. !  connection.
  353. !
  354. @LABEL 15
  355. HSReset 0 1 0 0 0 0
  356. ifANSWER 16
  357. pause 30
  358. @LABEL 16
  359. exit 0
  360. !
  361. !  Notice that the @ANSWER label is actually a comment here, and that
  362. !  @ORIGINATE and @ANSWER start at the same place.  What's the point of having
  363. !  separate entry points if they are not used?  Well, in the case of modems,
  364. !  when they dial out or wait for a call, the setup is usually the same.  One
  365. !  reason for separate entry points is when the script is not directly talking
  366. !  to a modem, but maybe to a PBX or terminal server.  It may be necessary to
  367. !  have completely different configuration for answering and originating
  368. !  connections.
  369. !
  370. ! @ANSWER
  371. ! Set up the modem to answer the telephone.
  372. !
  373. @LABEL 30
  374. write "ATS0=1\13"
  375. matchstr 1 31 "OK\13\10"
  376. matchread 30
  377. jump 59
  378. !
  379. !  What is userhook 1 doing in label 32?  Here's the idea:  Either this script
  380. !  controls a server that is waiting to answer the telephone, or it's waiting
  381. !  for a callback to a connection that was initiated.  AppleTalk Remote Access
  382. !  does a "passive" listen on the serial port (via the Serial Port Arbitrator)
  383. !  so that other communications applications can use the serial port when ARA
  384. !  is not using it.  When a call comes in for a server or callback, there
  385. !  will be about 5-14 seconds while the modems negotiate the connection.
  386. !  What would happen if a communications application on this Macintosh
  387. !  wanted to use the serial port during that time?  Both connections
  388. !  would fail.  The userhook 1 command tells ARA to mark the serial port in
  389. !  use.  When that happens, applications that want to use the serial port will
  390. !  be told it's busy, and the incoming connection can complete.  With that in
  391. !  mind, the strategy below is:  When the modem receives a ring, jump to label
  392. !  32, issue the userhook 1 command, then jump back up to label 31, wait for
  393. !  the connect result code and continue processing the script.
  394. !
  395. @LABEL 31
  396. matchstr 1  32 "RING\13\10"
  397. matchstr 2  11 "CONNECT 1200\13\10"
  398. matchstr 3  12 "CONNECT 2400\13\10"
  399. matchstr 4  13 "CONNECT 4800\13\10"
  400. matchstr 5  19 "CONNECT 7200\13\10"
  401. matchstr 6  14 "CONNECT 9600\13\10"
  402. matchstr 7  20 "CONNECT 12000\13\10"
  403. matchstr 8  18 "CONNECT 14400\13\10"
  404. matchstr 9  50 "NO CARRIER\13\10"
  405. matchstr 10 50 "ERROR\13\10"
  406. matchstr 11 52 "NO DIALTONE\13\10"
  407. matchstr 12 53 "BUSY\13\10"
  408. matchstr 13 54 "NO ANSWER\13\10"
  409. matchread 700
  410. jump 31
  411. !
  412. @LABEL 32
  413. userhook 1
  414. note "Answering phone..." 2
  415. jump 31
  416. !
  417. !  These are some common error messages when the line is busy, no dialtone,
  418. !  etc. They are documented in the Scripting Language Guide.  When the script
  419. !  exits with a code other than zero, Remote Access knows that the connection
  420. !  failed, and will inform the user with a dialog.
  421. !
  422. ! 50: error messages
  423. !
  424. @LABEL 50
  425. exit -6021
  426. !
  427. @LABEL 52
  428. exit -6020
  429. !
  430. @LABEL 53
  431. exit -6022
  432. !
  433. @LABEL 54
  434. exit -6023
  435. !
  436. @LABEL 59
  437. exit -6019
  438. !
  439. ! Hang up the modem
  440. ! Note:  Why try to enter command mode and hang up the line with ATH, when
  441. !        de-asserting DTR will always work, and it is used as a last resort
  442. !        anyway?  If DTR is used immediately,  the modem will hang up
  443. !        immediately.  This can have the ill effect of hanging up before all
  444. !        the data in the modem's internal transmit buffer has been sent.
  445. !        It is very desirable to have the last byte of data sent make
  446. !        it out of the modem and across the phone line.  Typically,
  447. !        the last packet sent is the disconnect packet, and if
  448. !        the other side misses this packet, it may have to wait up to 45
  449. !        seconds to hang up.
  450. !
  451. @HANGUP
  452. @LABEL 60
  453. settries 0
  454. HSReset 0 0 0 0 0 0
  455. @LABEL 61
  456. !
  457. !  Here's the basic logic for hanging up: If the modem can be configured
  458. !  to enter command mode when it receives a short break, send a short
  459. !  break.  Send an ATH to hang the line up (and if possible up in the
  460. !  configuration, set the modem to attempt to send all the data in the
  461. !  buffer before it disconnects).  If that fails, it must still be on
  462. !  line, so send the escape sequence to try to drop into command mode.
  463. !  Don't issue a short break again since it did not work the first time.
  464. !  If that fails, de-assert DTR which should force the modem to hang up
  465. !  (make sure the cable is wired properly for this option!).
  466. !  If +++ worked, don't send a short break again; flush the serial port
  467. !  buffer in case the ATH failed due to any stray data hanging around.
  468. !
  469. !  How was this sequence determined?  Trial and error.  Different vendor's
  470. !  modems behave differently when disconnecting.  Some modems will not enter
  471. !  command modem during a disconnect, and the only option is to de-assert DTR
  472. !  to force them to reset.  That's why DTR resets the modem instead of just
  473. !  disconnecting it!  Experiment with this sequence to make it function, but it
  474. !  should work with the majority of the modems available.
  475. !
  476. ! Now, since the Telebit modems will drop into command mode when they receive
  477. ! a short break (S61=1), issue one here.  This will speed up the disconnect
  478. ! sequence by about 5-6 seconds.  Then continue on with normal AT disconnect
  479. ! processing.
  480. !
  481. Sbreak
  482. !
  483. ! Wait a brief amount of time (1/2 second in this case) so the modem will be
  484. ! ready to accept the ATH command.  Pause 1 actually seems to work ok, but
  485. ! it's set to 5 just to be safe.
  486. !
  487. pause 5
  488. write "ATH\13"
  489. matchclr
  490. matchstr 1 63 "NO CARRIER\13\10"
  491. matchstr 2 63 "OK\13\10"
  492. matchstr 3 63 "ERROR\13\10"
  493. matchread 30
  494. inctries
  495. iftries 3 63
  496. ! no response, try escape sequence
  497. write "+++"
  498. matchclr
  499. matchstr 1 62 "OK\13\10"
  500. matchread 15
  501. !
  502. ! No Response from modem, toggle DTR
  503. !
  504. DTRClear
  505. pause 5
  506. DTRSet
  507. jump 61
  508. !
  509. @LABEL 62
  510. ! Pause 1 second to ensure we meet the escape time delay
  511. pause 10
  512. Flush
  513. write "ATH\13"
  514. matchstr 1 63 "OK\13\10"
  515. matchstr 2 63 "NO CARRIER\13\10"
  516. matchstr 3 63 "ERROR\13\10"
  517. matchread 30
  518. jump 61
  519. !
  520. !  Now that the modems have disconnected, and the script has possibly reset the
  521. !  modem, restore the factory settings.  Remember, the script may have hung up
  522. !  the modem in order to get ready for a callback, or it wants to get ready to
  523. !  wait to answer a call again.
  524. !
  525. ! recall the factory settings.  Use &F9 again (see note at top of script)
  526. !
  527. @LABEL 63
  528. matchclr
  529. matchstr 1 64 "OK\13\10"
  530. pause 15
  531. write "AT&F9\13"
  532. matchread 30
  533. !
  534. !  Now turn off auto answer if it was turned on to answer a call.  If this
  535. !  script controls a server, the @ANSWER sequence will be called by ARA.
  536. !  One other thing to watch out for here is that some modems expect to
  537. !  talk to the DTE at the last connected speed.  If this is a V.32bis
  538. !  modem and it just finished a connection with a 2400 baud modem, it
  539. !  doesn't necessarily want to talk at 2400 the next time!  Some modems
  540. !  don't exhibit this behavior, so play with it and see what happens.  Finally,
  541. !  since it successfully hung up,  exit the script with a result code of 0 to
  542. !  let Remote Access know everything worked.
  543. !
  544. ! Turn off auto answer, set S51 so modem will check interface
  545. ! speed on next connection.  If this is not done, the modem
  546. ! will not try to autobaud, with the result being it exits the
  547. ! script with an error.
  548. !
  549. ! S51=254 - Autobaud (19200 bps default)
  550. ! S0=0 - Don't try to answer the phone
  551. !
  552. @LABEL 64
  553. pause 5
  554. matchstr 1 65 "OK\13\10"
  555. write "ATS51=255S0=0\13"
  556. matchread 20
  557. !
  558. @LABEL 65
  559. exit 0
  560.  
  561.  
  562. Copyright 1992 Apple Computer, Inc.
  563.  
  564.